/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package midlet;
import canvas.SplashCanvas;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.MIDlet;

/**
 *
 * @author aisyah
 */
public class MainMidlet extends MIDlet {
    Display display;

    public MainMidlet(){
        display = Display.getDisplay(this);
    }

    public void startApp() {
        SplashCanvas splasC = new SplashCanvas(this);
        display.setCurrent(splasC);
        
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
         this.notifyDestroyed();
    }
     public void exitMIDlet() {
        switchDisplayable (null, null);
        destroyApp(true);
        notifyDestroyed();
    }

     public void switchDisplayable(Alert alert, Displayable nextDisplayable) {
        // write pre-switch user code here
        Display display = getDisplay();
        if (alert == null) {
            display.setCurrent(nextDisplayable);
        } else {
            display.setCurrent(alert, nextDisplayable);
        }
        // write post-switch user code here
    }
     public Display getDisplay () {
        return Display.getDisplay(this);
    }
}
